import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    breadCrumbs:{
      breadCrumbsName1:'',
      breadCrumbsName2:'',
      href:'',
      addressInfo:[],
    }
  },
  getters:{
    getBreadCrumbs:state=>{
      return state.breadCrumbs
    },
    getAddressInfo:state=>{
      return state.addressInfo
    }
  },
  mutations: {
    modifybreadCrumbs(state,obj){
      state.breadCrumbs.breadCrumbsName1=obj.breadCrumbsName1
      state.breadCrumbs.breadCrumbsName2=obj.breadCrumbsName2
      state.breadCrumbs.href=obj.href
    },
    changAddressInfo(state,payload){
      state.addressInfo = payload;
    }
  },
  actions: {
    setAddressInfo({commit},data){
      commit("changAddressInfo",data);
    }
  },
  modules: {
  }
})
